import Cookies from 'js-cookie';
const TOKEN_NAME = 'token';
const ACCOUNT = 'username';
const USER = 'user';
const REGISTER = 'register';
const DOMAIN = '';
const ADMIN = 'admin';
export const getToken = () => Cookies.get(TOKEN_NAME, { domain: DOMAIN });
export const setToken = token => Cookies.set(TOKEN_NAME, token, { domain: DOMAIN });
export const setAccount = account => Cookies.set(ACCOUNT, account, { domain: DOMAIN });
export const getAccount = () => Cookies.get(ACCOUNT, { domain: DOMAIN });
export const removeAccount = () => Cookies.remove(ACCOUNT, { domain: DOMAIN });
export const setUser = n => Cookies.set(USER, n, { domain: DOMAIN });
export const setRegister = n => Cookies.set(REGISTER, n, { domain: DOMAIN });
export const getRegister = () => Cookies.get(REGISTER, { domain: DOMAIN });
export const setAdmin = flag => Cookies.set(ADMIN, flag, { domain: DOMAIN });
export const removeAdmin = () => Cookies.remove(ADMIN, { domain: DOMAIN });
